<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-06-08 07:51:53
 * @LastEditTime: 2019-11-13 10:47:01
 * @LastEditors: Please set LastEditors
 -->
<template name="SWIPER">
  <view>
    <swiper
      autoplay="true"
      indicator-dots="true"
      circular="true"
      interval="5000"
      duration="1000"
      indicator-color="#FFFFFF"
      indicator-active-color="#0000FF"
      style="height: 235upx; width: 100%"
    >
      <swiper-item
        v-for="(img, key) in banners"
        :key="key"
        :data-urlType="key"
        :data-content="img.content"
        @click="goWebview"
      >
        <image
          :src="img"
          style="height: 235upx; width: 100%; border-radius: 20upx"
        ></image>
      </swiper-item>
    </swiper>
  </view>
</template>
<script>
import Vue from "vue";
export default {
  props: ["banners"],
  data() {
    return {};
  },
  methods: {
    goWebview(e) {
      let urlType = e.currentTarget.dataset.urltype + 2;
      if (urlType == 0) {
        let url = "./shequnfwz";
        Vue.customNavigateTo(url);
      } else if (urlType == 1) {
        let url = "./equitynew";
        Vue.customNavigateTo(url);
      } else if (urlType == 3) {
        let url = "./xxdk";
        Vue.customNavigateTo(url);
      } else {
        Vue.customSwitchTab(`./productCenter`);
      }
    },
  },
};
</script>
